package org.twdata.pipeline;

/**
 *  Thrown when a stage is specified but not available.
 */
public class StageNotFoundException extends PipelineException {

    private String id;
    
    /**
     *  Constructor
     *
     *@param  id  The missing stage id
     */
    public StageNotFoundException(String id) {
        super("Stage not found: "+id);
        this.id = id;
    }

    /**
     *  Constructor
     *
     *@param  id  The missing stage id
     *@param  ex   Wrapped throwable
     */
    public StageNotFoundException(String id, Throwable ex) {
        super("Stage not found: "+id, ex);
    }
    
    /**
     *  Gets the id of the stage that wasn't found
     *@return The missing stage id
     */
    public String getStageId() {
        return id;
    }

}

